System and method for ordering query results

ABSTRACT

A system, method and article of manufacture for managing query results and, more particularly, for sorting data records contained in a query result obtained in response to execution of a query against a database. In one embodiment, the data records in the query result are sorted on the basis of related information which is retrieved from a corresponding data source. In another embodiment, the sorting is performed on the basis of a value variance which is determined for each of the data records in the query result. In still another embodiment, the sorting is performed on the basis of a requested value range coverage. In yet another embodiment, the sorting is performed on the basis of suitability scores which are determined with respect to analysis routines which are configured for processing the query result.

CROSS-RELATED APPLICATION

This application is related to commonly owned, co-pending U.S. patentapplication Ser. No. _entitled “SYSTEM AND METHOD FOR SORTING DATARECORDS CONTAINED IN A QUERY RESULT”, filed herewith (Attorney DocketNo. ROC920040311 US1), and U.S. patent application Ser. No. 10/083,075,filed Feb. 26, 2002, entitled “APPLICATION PORTABILITY AND EXTENSIBILITYTHROUGH DATABASE SCHEMA AND QUERY ABSTRACTION”, which are bothincorporated herein in their entirety.

BACKGROUND OF THE INVENTION

1. Field of the Invention

The present invention generally relates to managing query results and,more particularly, to ordering data records contained in a query resultobtained in response to execution of a query against a database.

2. Description of the Related Art

Databases are computerized information storage and retrieval systems. Arelational database management system is a computer database managementsystem (DBMS) that uses relational techniques for storing and retrievingdata. The most prevalent type of database is the relational database, atabular database in which data is defined so that it can be reorganizedand accessed in a number of different ways. A distributed database isone that can be dispersed or replicated among different points in anetwork. An object-oriented programming database is one that iscongruent with the data defined in object classes and subclasses.

Regardless of the particular architecture, a DBMS can be structured tosupport a variety of different types of operations for a requestingentity (e.g., an application, the operating system or an end user). Suchoperations can be configured to retrieve, add, modify and deleteinformation being stored and managed by the DBMS. Standard databaseaccess methods support these operations using high-level querylanguages, such as the Structured Query Language (SQL). The term “query”denominates a set of commands that cause execution of operations forprocessing data from a stored database. For instance, SQL supports fourtypes of query operations, i.e., SELECT, INSERT, UPDATE and DELETE. ASELECT operation retrieves data from a database, an INSERT operationadds new data to a database, an UPDATE operation modifies data in adatabase and a DELETE operation removes data from a database.

Processing queries and query results can consume significant systemresources, particularly processor resources. Furthermore, one difficultywhen dealing with large query results, i.e., query results including alarge amount of data, is to identify relevant information therefrom.

A number of techniques have been employed to deal with this difficulty.For instance, query languages generally provide some functionality forordering query results so that retrieval of relevant information can besimplified. In SQL, for example, an ORDER BY clause can be used to orderrows of a given query result presented in a tabular form according to anascending or descending order of data contained in a user-selectedcolumn of the query result. Furthermore, a given query result can berepresented graphically to outline the information conveyed by the queryresult. However, such techniques still require a significant amount ofuser interaction to identify the relevant information, especially fromlarge query results. Thus, these techniques are an ineffective means tosupport users in easily and rapidly identifying relevant informationfrom query results.

Therefore, there is a need for an efficient technique for presentingquery results to users in order to simplify identification of relevantinformation therefrom.

SUMMARY OF THE INVENTION

The present invention is generally directed to a method, system andarticle of manufacture for managing query results and, moreparticularly, for ordering data records contained in a query resultobtained in response to execution of a query against a database.

One embodiment provides a computer-implemented method of ordering queryresults comprising, in response to a query issued by a requestingentity: (a) receiving a list of data records ordered according to aninitial order, the list of data records defining a result set for thequery; (b) before outputting the result set, accessing a data source toretrieve information related to the received list of data records; (c)sorting the received list of data records on the basis of the retrievedinformation; and (d) outputting the sorted list of data records.

Another embodiment provides a computer-implemented method of orderingquery results comprising, in response to a query issued by a requestingentity: (a) receiving a list of data records ordered according to aninitial order, the list of data records defining a result set for thequery; (b) before outputting the result set, determining a valuevariance for each data record in the list, the value variance of a givendata record indicating a relative proximity between a predefined valueand a corresponding value of the given data record; (c) sorting thereceived list of data records on the basis of the determined valuevariances; and (d) outputting the sorted list of data records.

Still another embodiment provides a computer-implemented method ofordering query results comprising, in response to a query issued by arequesting entity: (a) receiving a list of data records orderedaccording to an initial order, the list of data records defining aresult set for the query; (b) before outputting the result set,identifying a subset of the data records in the list to satisfy arequested value range coverage, the requested value range coverage beingdefined by a predefined maximum number of data records of the list to beoutput, each having a corresponding value within a predefined valuerange; (c) sorting the received list of data records on the basis of therequested value range coverage; and (d) outputting the sorted list ofdata records.

Still another embodiment provides a computer-readable medium containinga program which, when executed by a processor, performs operations forordering query results. The operations comprise, in response to a queryissued by a requesting entity: (a) receiving a list of data recordsordered according to an initial order, the list of data records defininga result set for the query; (b) before outputting the result set,accessing a data source to retrieve information related to the receivedlist of data records; (c) sorting the received list of data records onthe basis of the retrieved information; and (d) outputting the sortedlist of data records.

Still another embodiment provides a computer-readable medium containinga program which, when executed by a processor, performs operations forordering query results. The operations comprise, in response to a queryissued by a requesting entity: (a) receiving a list of data recordsordered according to an initial order, the list of data records defininga result set for the query; (b) before outputting the result set,determining a value variance for each data record in the list, the valuevariance of a given data record indicating a relative proximity betweena predefined value and a corresponding value of the given data record;(c) sorting the received list of data records on the basis of thedetermined value variances; and (d) outputting the sorted list of datarecords.

Still another embodiment provides a computer-readable medium containinga program which, when executed by a processor, performs operations forordering query results. The operations comprise, in response to a queryissued by a requesting entity: (a) receiving a list of data recordsordered according to an initial order, the list of data records defininga result set for the query; (b) before outputting the result set,identifying a subset of the data records in the list to satisfy arequested value range coverage, the requested value range coverage beingdefined by a predefined maximum number of data records of the list to beoutput, each having a corresponding value within a predefined valuerange; (c) sorting the received list of data records on the basis of therequested value range coverage; and (d) outputting the sorted list ofdata records.

Still another embodiment provides a computer system comprising arequesting entity, a data source residing in memory, and a sortingprogram for ordering query results obtained in response to a queryissued by the requesting entity. The sorting program is configured to:(a) receive a list of data records ordered according to an initialorder, the list of data records defining a result set for the query; (b)before outputting the result set, access the data source to retrieveinformation related to the received list of data records; (c) sort thereceived list of data records on the basis of the retrieved information;and (d) output the sorted list of data records.

Still another embodiment provides a computer system comprising arequesting entity and a sorting program for ordering query resultsobtained in response to a query issued by the requesting entity. Thesorting program is configured to: (a) receive a list of data recordsordered according to an initial order, the list of data records defininga result set for the query; (b) before outputting the result set,determine a value variance for each data record in the list, the valuevariance of a given data record indicating a relative proximity betweena predefined value and a corresponding value of the given data record;(c) sort the received list of data records on the basis of thedetermined value variances; and (d) output the sorted list of datarecords.

Yet another embodiment provides a computer system comprising arequesting entity and a sorting program for ordering query resultsobtained in response to a query issued by the requesting entity. Thesorting program is configured to: (a) receive a list of data recordsordered according to an initial order, the list of data records defininga result set for the query; (b) before outputting the result set,identify a subset of the data records in the list to satisfy a requestedvalue range coverage, the requested value range coverage being definedby a predefined maximum number of data records of the list to be output,each having a corresponding value within a predefined value range; (c)sort the received list of data records on the basis of the requestedvalue range coverage; and (d) output the sorted list of data records.

BRIEF DESCRIPTION OF THE DRAWINGS

So that the manner in which the above recited features of the presentinvention are attained can be understood in detail, a more particulardescription of the invention, briefly summarized above, may be had byreference to the embodiments thereof which are illustrated in theappended drawings.

It is to be noted, however, that the appended drawings illustrate onlytypical embodiments of this invention and are therefore not to beconsidered limiting of its scope, for the invention may admit to otherequally effective embodiments.

FIG. 1 is a data processing system illustratively utilized in accordancewith the invention;

FIGS. 2A-B are relational views of software components in oneembodiment;

FIG. 3 is a flow chart illustrating sorting of data records contained ina query result in one embodiment;

FIG. 4 is a flow chart illustrating sorting of data records contained ina query result in another embodiment;

FIGS. 5A-B are flow charts illustrating sorting of data recordscontained in a query result in still another embodiment;

FIGS. 6A-C are flow charts illustrating sorting of data recordscontained in a query result in still another embodiment;

FIGS. 7-8 are relational views of software components for query buildingsupport in one embodiment; and

FIGS. 9-10 are flow charts illustrating the operation of a runtimecomponent.

DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS

Introduction

The present invention is generally directed to a method, system andarticle of manufacture for managing query results and, moreparticularly, for sorting data records contained in a query result.According to one aspect, a user issues a query against a database. Inresponse to execution of the query, a list of data records defining aquery result is obtained. The data records in the received list of datarecords are ordered according to an initial order. The data records arethen sorted to provide a re-ordered query result which intelligentlyconveys information contained in the query result to the user.

In one embodiment, the sorting is performed on the basis of informationwhich is related to the received list of data records. For instance,annotations associated with the data records in the list are retrievedfrom a suitable data source. For each data record in the list, a totalnumber of associated annotations is counted. The total numbers can thenbe used as a basis for sorting the data records in the received list. Byway of example, data records having the greatest total number of countedannotations can be placed on the top of a corresponding sorted list.

In another embodiment, the sorting is performed on the basis of a valuevariance which is determined for each data record in the list. The valuevariance of a given data record indicates a relative proximity between apredefined value and a corresponding value of the given data record. Forinstance, a given query result may include data records having valueswhich are included within a specific value range. The value range mayinclude a center value which can be specified as the predefined value.The value variance of each of the values from the data records in thelist with respect to the predefined value (i.e., the center value) canbe determined. Accordingly, a relative proximity to the predefined valuecan be identified for each corresponding value of the data records.Thus, data records having values with a closest relative proximity tothe predefined value can be placed on the top of a corresponding sortedlist.

In still another embodiment, the sorting is performed on the basis of arequested value range coverage. The requested value range coverage isdefined by a predefined maximum number of data records of the list to beoutput according to a requested value distribution, each data recordhaving a corresponding value within a predefined value range. Forinstance, a given query result may include a multiplicity of datarecords having corresponding values. All such corresponding values arespread over a given value range. From the multiplicity of data records,only a portion should be output according to a predefined maximum numberin order to define a requested value distribution. The requested valuedistribution can be defined by any possible type of distribution, suchas a uniform distribution (also referred to as “flat distribution”) anda normal distribution (also referred to as “bell curve”). A flatdistribution consists of values that are evenly distributed betweenupper and lower bounds. A bell curve consists of values which areselected such that the frequency of selection is weighted towards acenter, or average, value within upper and lower bounds. Accordingly,the predefined maximum number of data records is selected from themultiplicity of data records such that the corresponding values of theselected data records define the requested value distribution. Thus, theone or more selected data records can be placed on the top of acorresponding sorted list.

In still another embodiment, the sorting is performed on the basis ofsuitability scores which are determined with respect to availableanalysis routines. To this end, a suitability score is determined foreach data record in the list. The suitability score for a given datarecord indicates a relative suitability of the given data record asinput to one or more analysis routines. Thus, data records which aremost suitable as input to the one or more analysis routines can beplaced on the top of a corresponding sorted list.

It is noted that particular embodiments described herein may refer tore-ordering of specific requested data. For example, embodiments may bedescribed with reference to re-ordering of query results obtained inresponse to execution of queries against databases. However, referencesto re-ordering of query results are merely for purposes of illustrationand not limiting of the invention. More broadly, re-ordering of anysuitable data received in a list form in response to a request for thedata (whether or not the request be a query, per se) is contemplated.

Preferred Embodiments

In the following, reference is made to embodiments of the invention.However, it should be understood that the invention is not limited tospecific described embodiments. Instead, any combination of thefollowing features and elements, whether related to differentembodiments or not, is contemplated to implement and practice theinvention. Furthermore, in various embodiments the invention providesnumerous advantages over the prior art. However, although embodiments ofthe invention may achieve advantages over other possible solutionsand/or over the prior art, whether or not a particular advantage isachieved by a given embodiment is not limiting of the invention. Thus,the following aspects, features, embodiments and advantages are merelyillustrative and, unless explicitly present, are not considered elementsor limitations of the appended claims.

One embodiment of the invention is implemented as a program product foruse with a computer system such as, for example, computer system 110shown in FIG. 1 and described below. The program(s) of the programproduct defines functions of the embodiments (including the methodsdescribed herein) and can be contained on a variety of signal-bearingmedia. Illustrative signal-bearing media include, but are not limitedto: (i) information permanently stored on non-writable storage media(e.g., read-only memory devices within a computer such as CD-ROM disksreadable by a CD-ROM drive); (ii) alterable information stored onwritable storage media (e.g., floppy disks within a diskette drive orhard-disk drive); or (iii) information conveyed to a computer by acommunications medium, such as through a computer or telephone network,including wireless communications. The latter embodiment specificallyincludes information downloaded from the Internet and other networks.Such signal-bearing media, when carrying computer-readable instructionsthat direct the functions of the present invention, representembodiments of the present invention.

In general, the routines executed to implement the embodiments of theinvention, may be part of an operating system or a specific application,component, program, module, object, or sequence of instructions. Thesoftware of the present invention typically is comprised of a multitudeof instructions that will be translated by the native computer into amachine-readable format and hence executable instructions. Also,programs are comprised of variables and data structures that eitherreside locally to the program or are found in memory or on storagedevices. In addition, various programs described hereinafter may beidentified based upon the application for which they are implemented ina specific embodiment of the invention. However, it should beappreciated that any particular nomenclature that follows is used merelyfor convenience, and thus the invention should not be limited to usesolely in any specific application identified and/or implied by suchnomenclature. Further, it is understood that while reference may be madeto particular query languages, including SQL, the invention is notlimited to a particular language, standard or version. Accordingly,persons skilled in the art will recognize that the invention isadaptable to other query languages and that the invention is alsoadaptable to future changes in a particular query language as well as toother query languages presently unknown.

Referring now to FIG. 1, a computing environment 100 is shown. Ingeneral, the distributed environment 100 includes computer system 110and a plurality of networked devices 146. The computer system 110 mayrepresent any type of computer, computer system or other programmableelectronic device, including a client computer, a server computer, aportable computer, an embedded controller, a PC-based server, aminicomputer, a midrange computer, a mainframe computer, and othercomputers adapted to support the methods, apparatus, and article ofmanufacture of the invention. In one embodiment, the computer system 110is an eServer computer available from International Business Machines ofArmonk, N.Y.

Illustratively, the computer system 110 comprises a networked system.However, the computer system 110 may also comprise a standalone device.In any case, it is understood that FIG. 1 is merely one configurationfor a computer system. Embodiments of the invention can apply to anycomparable configuration, regardless of whether the computer system 110is a complicated multi-user apparatus, a single-user workstation, or anetwork appliance that does not have non-volatile storage of its own.

The embodiments of the present invention may also be practiced indistributed computing environments in which tasks are performed byremote processing devices that are linked through a communicationsnetwork. In a distributed computing environment, program modules may belocated in both local and remote memory storage devices. In this regard,the computer system 110 and/or one or more of the networked devices 146may be thin clients which perform little or no processing.

The computer system 110 could include a number of operators andperipheral systems as shown, for example, by a mass storage interface137 operably connected to a direct access storage device 138, by a videointerface 140 operably connected to a display 142, and by a networkinterface 144 operably connected to the plurality of networked devices146. The display 142 may be any video output device for outputtingviewable information.

Computer system 110 is shown comprising at least one processor 112,which obtains instructions and data via a bus 114 from a main memory116. The processor 112 could be any processor adapted to support themethods of the invention. The main memory 116 is any memory sufficientlylarge to hold the necessary programs and data structures. Main memory116 could be one or a combination of memory devices, including RandomAccess Memory, nonvolatile or backup memory, (e.g., programmable orFlash memories, read-only memories, etc.). In addition, memory 116 maybe considered to include memory physically located elsewhere in thecomputer system 110, for example, any storage capacity used as virtualmemory or stored on a mass storage device (e.g., direct access storagedevice 138) or on another computer coupled to the computer system 110via bus 114.

The memory 116 is shown configured with an operating system 118. Theoperating system 118 is the software used for managing the operation ofthe computer system 110. Examples of the operating system 118 includeIBM OS/400®, UNIX, Microsoft Windows®, and the like.

The memory 116 further includes one or more applications 120 and anabstract model interface 130. The applications 120 and the abstractmodel interface 130 are software products comprising a plurality ofinstructions that are resident at various times in various memory andstorage devices in the computer system 110. When read and executed byone or more processors 112 in the computer system 110, the applications120 and the abstract model interface 130 cause the computer system 110to perform the steps necessary to execute steps or elements embodyingthe various aspects of the invention.

Illustratively, the applications 120 include an application queryspecification 122, one or more requesting applications 124, each havinga sorting program 126, and analysis routines 180. The requestingapplication(s) 124 (and more generally, any requesting entity, includingthe operating system 118) is configured to issue queries against data136 in a database 139. Illustratively, the database 139 is shown as partof a database management system (DBMS) 154 in storage 138. The database139 is representative of any collection of data regardless of theparticular physical representation of the data. A physicalrepresentation of data defines an organizational schema of the data. Byway of illustration, the database 139 may be organized according to arelational schema (accessible by SQL queries) or according to an XMLschema (accessible by XML queries). However, the invention is notlimited to a particular schema and contemplates extension to schemaspresently unknown. As used herein, the term “schema” generically refersto a particular arrangement of data.

The queries issued by the requesting application(s) 124 are definedaccording to the application query specification 122 included with eachrequesting application 124. The queries issued by the requestingapplication(s) 124 may be predefined (i.e., hard coded as part of therequesting application(s) 124) or may be generated in response to input(e.g., user input). In either case, the queries (referred to herein as“abstract queries”) can be composed using logical fields defined by theabstract model interface 130. A logical field defines an abstract viewof data whether as an individual data item or a data structure in theform of, for example, a database table. In particular, the logicalfields used in the abstract queries are defined by a data abstractionmodel component 132 of the abstract model interface 130. A runtimecomponent 134 transforms the abstract queries into concrete querieshaving a form consistent with the physical representation of the datacontained in the database 139. The concrete queries can be executed bythe runtime component 134 against the database 139. Operation of theruntime component 134 is further described below with reference to FIGS.7-10.

It should be noted that embodiments of the present invention can beexplained below, by way of example, with reference to abstract querieswhich are created on the basis of a corresponding data abstractionmodel. However, other embodiments can be implemented using other typesof queries and database representations, such as SQL or XML queriesissued against data in databases having an underlying relational or XMLdata representation. Accordingly, the present invention is not limitedto a particular query environment, including abstract queries and dataabstraction models, and various different query environments andimplementations are broadly contemplated

In one embodiment, a result set is obtained from the data 136 inresponse to execution of a given query against the database 139. Theresult set defines a query result which is ordered according to aninitial order. Using functions which are invoked by the sortingprogram(s) 126 of the requesting application(s) 124, the query resultcan be re-ordered to simplify retrieval of relevant informationtherefrom. Specifically, the query result can be re-ordered tofacilitate retrieval of relevant information required for subsequentprocessing of the query result using one or more of the analysisroutines 180. Operation and interaction of the requesting application(s)124 and the analysis routines 180 are further described below withreference to FIGS. 2A-6C.

It should be noted that the sorting program(s) 126 are illustrated as anintegral part of the requesting application(s) 124 for purposes ofillustration. However, it should be noted that the sorting program(s)126 can be implemented as separate application(s) which is independentof the requesting application(s) 124. Accordingly, any suitableimplementation of the requesting application(s) 124 and the sortingprogram(s) 126 is broadly contemplated.

Referring now to FIG. 2A, a block diagram of a computing environment forre-ordering of requested data in one embodiment is shown.Illustratively, the computing environment includes the requestingapplication(s) 124 having the sorting program(s) 126, the database 139having the data 136, the display device 142 and the analysis routines180 of FIG. 1, as well as a user interface 210.

By way of example, the requesting application(s) 124 issues a datarequest 220 (e.g., a query) against the data 136 in the database 139. Inone embodiment, the data request 220 is created by a user using the userinterface 210. The data request 220 is executed against the database 139to obtain a corresponding result set of data from the data 136 (e.g., aquery result) using the DBMS 154.

In response to the data request 220, requested data 230 defining thecorresponding result set is identified from the data 136. The requesteddata 230 is ordered according to an initial order and returned to therequesting application(s) 124. In one embodiment, the requested data 230is presented as an ordered list of data records.

Using functions invoked by the sorting program(s) 126, the requesteddata 230 is re-ordered, i.e., the data records in the ordered list aresorted in order to reduce the complexity of retrieving relevantinformation therefrom. Sorting the data records of a received list ofdata records according to predefined criteria is described in moredetail below with reference to FIGS. 2B-6C. After sorting the datarecords in the ordered list, the sorted requested data 240 is output tothe display device 142 for display. Accordingly, the sorted requesteddata 240 can be presented on the display device 142 as a sorted list ofdata records. The sorted requested data 240 can subsequently beprocessed using one or more of the analysis routines 180.

In one embodiment, the sorting program(s) 126 sorts the data records inthe ordered list on the basis of related information 258 which isretrieved from a corresponding data source 252. In order to retrieve therelated information 258, the sorting program(s) 126 issues a sortrequest 222 against the data source 252. The sort request 252 isexecuted against the data source 252 using a DBMS 256 which manages thedata source 252.

According to one aspect, the requesting application(s) 124 and thesorting program(s) 126 are implemented as a single, integrated softwareproduct resident at the server-side or the client-side. Furthermore, thesorting can be done by a client-side application (e.g., the requestingapplication(s) 124 having the sorting program(s) 126) and the requesteddata 230 is received from a server-side database (e.g., the database139). However, it should be noted that alternative embodiments arecontemplated. For instance, the sorting program(s) 126 can beimplemented by a server-side application in which case the sorting canbe done on a server machine having the database 139. In anotherembodiment, the sorting program(s) 126 and the database 139 can beresident on a common computer system.

Referring now to FIG. 2B, exemplary functions which can be called by thesorting program(s) 126 of FIG. 2A for re-ordering the requested data 230are shown in more detail. Specifically, the sorting program(s) 126 caninvoke various functions which are configured for pre- andpost-processing of the data request 220 and the requested data 230 ofFIG. 2A.

As was noted above with reference to FIG. 2A, the requested data 230 isretrieved from the data 136 in the database 139 using the DBMS 154.According to one aspect, the requested data 230 is presented in atabular form having a plurality of rows and columns. Illustratively, theplurality of rows includes rows “A”, “B”, “C” and “D”, and the pluralityof columns includes columns “E”, “F”, “G” and “H”. By way of example,the plurality of rows is shown having an initial order “ABCD” and theplurality of columns is shown having an order “EFGH”. Each of the rows“A”, “B”, “C” and “D” represents a data record, so that the requesteddata 230 defines an ordered list of data records having the initialorder “ABCD”.

The sorting program(s) 126 receives the ordered list of data records(i.e., the requested data 230) as input and sorts the data records “A”,“B”, “C” and “D” of the received list. Illustratively, the sortingprogram(s) 126 sorts the data records “A”, “B”, “C” and “D” of therequested data 230 such that the sorted data records have the order“CADB” in the sorted requested data 240. After sorting the data records,the sorting program(s) 126 outputs the sorted list of the data records(i.e., the sorted requested data 240) to the display device 142.Exemplary embodiments of operations for sorting data records of areceived list of data records are described below with reference toFIGS. 3-6C.

Sorting on the Basis of Related Information

More specifically, in the embodiment illustrated in FIB. 2B, there-ordering of the requested data 230 is performed on the basis ofinformation (e.g., related information 258 of FIG. 2A) which is relatedto the received list of data records “A”, “B”, “C” and “D” defining therequested data 230. In order to determine the related information, thesorting program(s) 126 invokes an information determination unit 250having a sub-query generator 257. It should be noted that theinformation determination unit 250 is represented as a separate unitonly by way of example and not for limiting the invention accordingly.In other words, the information determination unit 250 can also beimplemented as an integral part of the sorting program(s) 126 or someother suitable system program.

The information determination unit 250 accesses a data source 252 todetermine the related information therefrom. To this end, the sub-querygenerator 257 generates the sort request 222 of FIG. 2A which is issuedagainst the data source 252 for retrieving the related information usingthe DBMS 256. In the illustrated example, the data source 252 includesannotations 254 associated with the data records “A”, “B”, “C” and “D”.However, it should be noted that annotations are merely one example ofinformation related to data records. Any suitable related informationincluding annotations can be used as a basis for re-ordering therequested data 230. More generally, any reference to the data recordscan be used as a basis for the re-ordering. Accordingly, all suchsuitable types of related information are broadly contemplated.Furthermore, the annotations themselves can be classified based on anorganization type in which the creators of the annotations are working.For example, data records which have been annotated by individualsworking in the same technological field of study can be preferred togeneral annotations. Moreover, the annotations can be ranked on thebasis of hierarchical positions of the creators of the annotations. Forinstance, for a researcher who performs a study on a liver disease,annotations made by a chief site specialist are certainly preferred tothose of assistants.

According to one aspect, the information determination unit 250 counts atotal number of associated annotations for each of the data records ofthe requested data 230. The counted total numbers are then used as abasis for sorting the data records. By way of example, assume that forthe data record “C” a total number of 76 associated annotations iscounted. Similarly, a total number of 62 annotations is counted for thedata record “A”, a total number of 43 annotations is counted for thedata record “D”, and a total number of 15 annotations is counted for thedata record “B”. Assume further that the data record having the greatesttotal number of annotations is placed on the top of the sorted list ofdata records defining the sorted requested data 240. Accordingly, thedata records “A”, “B”, “C” and “D” are programmatically sorted in thesorted requested data 240 according to the order “CADB”, as illustrated.An exemplary method for re-ordering the requested data 230 on the basisof information which is related to the received list of data recordsdefining the requested data 230 is described below with reference toFIG. 3.

Referring now to FIG. 3, one embodiment of a method 300 for re-orderingrequested data (e.g., requested data 230 of FIG. 2B) on the basis ofinformation (e.g., annotations 254 of FIG. 2B) which is related to therequested data is shown. The requested data is obtained in response toexecution of a corresponding data request against data in a database(e.g., data 136 of database 139 of FIG. 2A). At least part of the stepsof the method 300 can be performed by a suitable requesting entity(e.g., requesting application(s) 124 of FIG. 2A) and suitablefunctionalities of an associated sorting program(s) (e.g., sortingprogram(s) 126 of FIG. 2B).

By way of example, the method 300 is explained with respect to a datarequest being implemented as a query against the data in the databasefor purposes of illustration. In this case, the requested data is aresult set of data which defines a query result.

Method 300 starts at step 310. At step 320, the query is issued by thesuitable requesting entity. The issued query is executed against thedata in the database. An exemplary query is shown in Table I below. Forsimplicity, the exemplary query of Table I is described in naturallanguage without reference to a particular query language. Thus, it isunderstood that any suitable query language, known or unknown, can beused to create the query of Table I. TABLE I QUERY EXAMPLE FIND ID,Name, Age SORT BY number of associated annotations

Illustratively, the exemplary query shown in Table I includes dataselection criteria in lines 001-002. The data selection criteria includea result field specification (line 002) which specifies three resultfields for which information is to be returned in the query result.Specifically, in line 002 the result fields “ID”, “Name” and “Age” arespecified. The exemplary query further includes sorting criteria inlines 003-004. The sorting criteria indicate that all data records inthe query result should be sorted according to counted numbers ofannotations associated with the data records (line 004).

Assume now that data related to the result fields “ID”, “Name” and “Age”of the exemplary query of Table I is included with a database table“Demographic”. An exemplary “Demographic” table is shown in Table IIbelow. TABLE II EXEMPLARY DATABASE TABLE “DEMOGRAPHIC” ID Name Age 3Renee 24 1 Karl 54 2 Kris 49

Illustratively, the exemplary database table “Demographic” includes an“ID”, “Name” and “Age” column. The “ID” column contains a uniqueidentifier for each of the data records included with lines 002-004. The“Name” column includes names of individuals and the “Age” columncontains information about the age of the corresponding individuals.

Assume further that the annotations required for the sorting of thequery result are included with a database table named “Annotations”. Anexemplary “Annotations” table is shown in Table III below. TABLE IIIEXEMPLARY DATABASE TABLE “ANNOTATIONS” Note_ID Patient_ID Date Comment453 1 1/2/04 Karl has three broken toes 454 2 1/3/04 Kris has a badsunburn 455 1 1/4/04 Karl has a cut finger

Illustratively, the exemplary database table “Annotations” includes a“Node_ID”, “Patient_ID”, “Date” and “Comment” column. The “Node_ID”column contains a unique identifier for each of the data recordsincluded with lines 002-004. The “Patient_ID” column includes patientidentifiers according to the “ID” column of the “Demographic” table ofTable II above. The “Date” column contains indications of dates onwhich, for example, a corresponding diagnosis has been established for agiven patient. The “Comment” column contains annotations with respect tothe established diagnoses.

In one embodiment, executing the query at step 320 includes generating adata query (e.g., data request 220 of FIG. 2A) and a sorting query(e.g., sort request 222 of FIG. 2A) using a suitable sub-querygenerator. More specifically, the issued query includes: (i) dataselection criteria (e.g., data selection criteria in lines 001-002 ofTable I) configured to select data records defining the query resultfrom the data in the database, and (ii) sorting criteria (e.g., sortingcriteria in lines 003-004 of Table I) configured to specify theinformation related to the data records of the query result. The dataquery is generated on the basis of the data selection criteria and thesorting query is generated on the basis of the sorting criteria.Accordingly, the data query is used to determine the query result in aninitial order on the basis of the data selection criteria. The sortingquery is used to sort the data records in the determined query result onthe basis of the sorting criteria. In the given example, the data queryshown in Table IV below can be generated from the exemplary query ofTable I above using the suitable sub-query generator. TABLE IV DATAQUERY EXAMPLE FIND ID, Name, Age FROM Demographic

Illustratively, the exemplary data query shown in Table IV includes dataselection criteria in lines 001-002 which correspond to the dataselection criteria in lines 001-002 of Table I. The exemplary data queryfurther includes a specification of the database table which containsthe requested data (lines 003-004), i.e., the “Demographic” table ofTable II above. Assume for simplicity that the suitable sub-querygenerator retrieves the table named “Demographic” from the issued queryof Table I above. Furthermore, the sorting query shown in Table V belowcan be generated from the exemplary query of Table I above. TABLE VSORTING QUERY EXAMPLE FIND Patient_ID, count(comment) FROM AnnotationsGROUP BY Patient_ID

Illustratively, the exemplary sorting query shown in Table V includesdata selection criteria in lines 001-002 for selection of the requiredrelated information, and a specification of the database table whichcontains the related information in lines 003-004, i.e., the“Annotations” table of Table III above. According to one aspect, acorresponding rule may indicate to the suitable sub-query generator(e.g., sub-query generator 257 of FIG. 2B) that the related informationabout annotations is contained in the database table named“Annotations”. Furthermore, the sorting criteria “SORT BY number ofassociated annotations” in lines 003-004 of Table I specify that thequery result should be sorted with respect to a number of annotationsassociated with each data record contained in the query result. As thedata records in the query result are identified by patient identifiers(“Patient_ID”), annotations (“comment” in line 002) with respect topatients which are identified by corresponding patient identifiers(“Patient_ID” in line 002) are retrieved. Furthermore, all retrievedannotations are counted for each data record associated with one of theretrieved patient identifiers (“count(comment)” in line 002). Moreover,a ranking of the counted retrieved annotations is established accordingto the sorting query of Table V by grouping the counted numbers ofannotations (lines 005-006) per patient.

At step 330, the query result in an initial order is received. In oneembodiment, the query result is presented in a list form having aplurality of data records. In the given example, receiving the queryresult in the initial order corresponds to receiving a query result(hereinafter referred to as “data query result”) obtained in response toexecution of the data query of Table IV against the exemplary“Demographic” table of Table II. Accordingly, the data query resultshown in Table VI below is received. TABLE VI EXEMPLARY DATA QUERYRESULT ID Name Age 3 Renee 24 1 Karl 54 2 Kris 49

Note that in the given example the exemplary data query result of TableVI corresponds to the database table shown in Table II above.

At step 340, a data source (e.g., data source 252 of FIG. 2B) isaccessed to retrieve annotations (e.g., one or more of the annotations254 of FIG. 2B) for at least a portion of the data records contained inlines 002-004 of the data query result of Table VI above. At step 350, atotal number of retrieved annotations is counted for each one of thedata records. In the given example, steps 340 and 350 can beaccomplished by executing the sorting query of Table V against the“Annotations” table of Table II. Accordingly, the exemplary query result(hereinafter referred to as “sorting query result”) shown in Table VIIbelow is received. TABLE VII EXEMPLARY SORTING QUERY RESULT Patient_IDNumber of Annotations 1 2 2 1

Note that according to line 002 the patient identifier “1” has twoassociated annotations (in lines 002 and 004 of Table III). According toline 003, the patient identifier “2” has only one associated annotation(in line 003 of Table III).

At step 360, a ranking of the data records in lines 002-004 of the dataquery result in Table VI above is determined on the basis of the countedtotal numbers of retrieved associated annotations. To this end, the dataquery result of Table VI can be augmented with the exemplary sortingquery result of Table VII, in the given example. Accordingly, theaugmented query result shown in Table VIII below is obtained. TABLE VIIIEXEMPLARY AUGMENTED QUERY RESULT ID Name Age Number of Annotations 3Renee 24 0 1 Karl 54 2 2 Kris 49 1

Note that in the given example the exemplary augmented query result ofTable VIII corresponds to the data query result shown in Table VI above,wherein a column containing the counted numbers of annotations accordingto Table VII has been inserted. Furthermore, as can be seen from the“Number of Annotations” column, the following ranking can beestablished: (1) the data record of line 003 has the most associatedannotations, (2) the data record in line 004 has the second mostassociated annotations, and (3) the data record in line 002 has noassociated annotations at all.

By way of example, the above ranking is performed on the basis of thecounted numbers of annotations. However, as was noted above it should benoted that types and/or attributes of the annotations can also beconsidered when establishing the ranking. For instance, the annotationscan be weighted based on an organization hierarchy or type of thecreators of the annotations. Furthermore, the annotations can beweighted so that some annotations are weighted relatively more heavilythan others. For example, assume that the annotation in line 003 ofTable III which is related to “Kris” was made by a chief site specialistwhile the annotations in lines 002 and 004 of Table III, which are bothrelated to “Karl”, were made by an assistant. In this case, it might bedesirable to weight the annotation made by the chief site specialistsuch that the one annotation associated with “Kris” is considered moreimportant than the two annotations associated with “Karl”.

At step 370, the data records in the received query result (i.e., dataquery result of Table VI) are sorted on the basis of the determinedranking. Accordingly, the exemplary sorted query result shown in TableIX below is obtained. TABLE IX EXEMPLARY SORTED QUERY RESULT ID Name Age1 Karl 54 2 Kris 49 3 Renee 24

Note that in the given example the data records in lines 002-004 ofTable IX are sorted according to the above described ranking.Accordingly, the data record of line 003 of Table VI is presented on thetop of the exemplary sorted query result, i.e., in line 002 of Table IX,as this data record has the greatest counted number of associatedannotations.

At step 380, the sorted list of data records (e.g., sorted requesteddata 240 of FIG. 2B) is output. For instance, the sorted list is outputfor display on a display device (e.g., display device 142 in FIG. 2B).In other words, in the given example the exemplary sorted query resultof Table IX is output. Method 300 then exits at step 390.

Sorting on the Basis of Value Variances

Referring now back to FIG. 2B, the re-ordering of the requested data 230is performed in another embodiment on the basis of a value variancewhich is determined for each of the data records of the requested data230. The value variance of a given data record indicates a relativeproximity between a predefined value 262 and a corresponding value ofthe given data record.

In order to determine the value variance for each data record of therequested data 230, the sorting program(s) 126 illustratively invokes avalue variance determination unit 260. It should be noted that the valuevariance determination unit 260 is represented as a separate unit onlyby way of example and not for limiting the invention accordingly. Inother words, the value variance determination unit 260 can also beimplemented as an integral part of the sorting program(s) 126 or someother suitable system program.

The value variance determination unit 260 illustratively includes thepredefined value 262. According to one aspect, the predefined value 262can be provided by a user using a suitable user interface (e.g., userinterface 210 of FIG. 2A). In one embodiment, each one of the datarecords of the requested data 230 has a particular value of a type whichcorresponds to an underlying value type of the predefined value 262. Forinstance, each one of the data records may include a particular valuerelated to a hemoglobin test and the predefined value 262 may representa user-specified value of interest for hemoglobin tests. Morespecifically, assume that the particular values of the data records arehemoglobin test result values between 12 and 14. Assume further that auser specifies 13.5 as a central or ideal interest value, i.e., thepredefined value 262. Thus, the data records having particular valueswhich are the most close to the central or ideal interest value of 13.5can be identified from the requested data 230.

To this end, the value variance determination unit 260 determines thevalue variance of the particular value of each of the data records ofthe requested data 230 with respect to the predefined value 262. Thus,for each one of the data records a relative proximity between thecorresponding particular value and the predefined value 262 can beidentified. According to one aspect, the data records having theparticular values with the closest relative proximity to the predefinedvalue 262 are programmatically placed on the top of the sorted list ofdata records defining the sorted requested data 240. An exemplary methodfor re-ordering the requested data 230 on the basis of a value variancewhich is determined for each of the data records of the requested data230 is described below with reference to FIG. 4.

Referring now to FIG. 4, one embodiment of a method 400 for re-orderingrequested data (e.g., requested data 230 of FIG. 2B) on the basis ofvalue variances is shown. The requested data is obtained in response toexecution of a corresponding data request (e.g., data request 220 ofFIG. 2A) against data in a database (e.g., data 136 of database 139 ofFIG. 2A). Similarly to the method 300 of FIG. 3, the method 400 isexplained by way of example with respect to a query issued against thedata in the database in order to obtain a corresponding query result. Atleast part of the steps of the method 400 can be performed by a suitablerequesting entity (e.g., requesting application(s) 124 of FIG. 2A) andsuitable functionalities of an associated sorting program(s) (e.g.,sorting program(s) 126 of FIG. 2B). Method 400 starts at step 410.

At step 420, the query is issued by a suitable requesting entity (e.g.,requesting application(s) 124 of FIG. 2A). The issued query is executedagainst the data in the database. An exemplary query is shown in Table Xbelow. For simplicity, the exemplary query of Table X is described innatural language without reference to a particular query language. Thus,it is understood that any suitable query language, known or unknown, canbe used to create the query of Table X. TABLE X QUERY EXAMPLE FINDPatient_ID, Hemoglobin SORT BY proximity to Hemoglobin = 34

Illustratively, the exemplary query shown in Table X includes dataselection criteria in lines 001-002. The data selection criteria includea result field specification (line 002) which specifies two resultfields for which information is to be returned in the query result.Specifically, in line 002 the result fields “Patient_ID” and“Hemoglobin” are specified. The exemplary query further includes sortingcriteria in lines 003-004. The sorting criteria indicate that all datarecords in the query result should be sorted with respect to apredefined Hemoglobin value (e.g., predefined value 262 of FIG. 2B) of“34” (line 004). More specifically, each Hemoglobin test value includedwith a data record of the query result is compared with the predefinedHemoglobin value to identify a relative proximity thereto.

Assume now that information related to the result fields “Patient_ID”and “Hemoglobin” of the exemplary query of Table X is included with adatabase table “Tests”. An exemplary “Tests” table is shown in Table XIbelow. TABLE XI EXEMPLARY DATABASE TABLE “TESTS” Patient_ID DateHemoglobin 1  1/2/04 29 1  16/7/04 23 3  5/5/04 35 2  12/8/04 45 219/10/04 33

Illustratively, the exemplary database table “Tests” includes a“Patient_ID”, “Date” and “Hemoglobin” column. By way of example, the“Patient_ID” column includes patient identifiers according to the “ID”column of the “Demographic” table of Table II above. The “Date” columncontains exemplary dates at which a corresponding Hemoglobin test hasbeen performed on a given patient. The “Hemoglobin” column includesHemoglobin test values which have been determined at the indicateddates.

In one embodiment, executing the query at step 420 includes identifyingthe data selection criteria and the sorting criteria from the issuedquery. Executing the query further includes generating a data query onthe basis of the identified data selection criteria and executing thedata query against the database. In the given example, the dataselection criteria “FIND Patient_ID, Hemoglobin” can be identified fromthe issued query (lines 001-002 of Table X). Furthermore, the sortingcriteria “SORT BY proximity to Hemoglobin=34” can be identified from theissued query (lines 003-004 of Table X). On the basis of the identifieddata selection criteria, the data query shown in Table XII below can begenerated. TABLE XII DATA QUERY EXAMPLE FIND Patient_ID, Hemoglobin FROMTests

Illustratively, the exemplary data query shown in Table XII includes thedata selection criteria of lines 001-002 of Table X. The exemplary dataquery further includes a specification of the database which containsthe requested data (lines 003-004), i.e., the “Tests” table of Table XIIabove.

At step 430, the query result in an initial order is received. Receivingthe query result in the initial order corresponds to receiving a dataquery result obtained in response to execution of the data query ofTable XII against the exemplary “Tests” table of Table XI. The dataquery result shown in Table XIII below is received in the given example.TABLE XIII EXEMPLARY DATA QUERY RESULT Patient_ID Hemoglobin 1 29 1 23 335 2 45 2 33

Note that in the given example the exemplary data query result of TableXIII corresponds to the database table shown in Table XI above, wherethe “Date” column has been removed.

At step 440, a value variance is determined for each one of the datarecords contained in the data query result of Table XIII to determinethe relative proximities. Illustratively, the data query result can beaugmented with a column indicating the determined value variances.Accordingly, the augmented query result shown in Table XIV below isobtained. TABLE XIV EXEMPLARY AUGMENTED QUERY RESULT Patient_IDHemoglobin Value Variance 1 29  5 1 23 11 3 35  1 2 45 11 2 33  1

Note that in the given example the exemplary augmented query result ofTable XIV corresponds to the data query result shown in Table XIIIabove, wherein a column containing the determined value variances hasbeen inserted. Each value variance is defined by the difference betweenthe returned Hemoglobin value and the predefined Hemoglobin value. Ascan be seen from Table XIV, the data record in line 005 has a Hemoglobinvalue of “45”. Thus, the value variance for this data record can bedetermined according to one aspect by subtracting the predefinedHemoglobin value of “34” therefrom, i.e., 45−34=11.

At step 450, a ranking of the data records is determined on the basis ofthe determined relative proximities, i.e., the determined valuevariances. As can be seen from the “Value Variance” column of Table XIV,the following ranking can be established: (1) the data records of lines003 and 006 have a value variance of “1” and, thus, the closest relativeproximity with respect to the predefined Hemoglobin value, (2) the datarecord of line 001 has a value variance of “5” and, thus, the secondclosest relative proximity, and (3) the data records of lines 002 and005 have a value variance of “11” and, thus, the farthest relativeproximity.

At step 460, the data records in the data query result of Table XIII aresorted on the basis of the determined ranking. Accordingly, theexemplary sorted query result shown in Table XV below is obtained. TABLEXV EXEMPLARY SORTED QUERY RESULT Patient_ID Hemoglobin 2 33 3 35 1 29 123 2 45

Note that in the given example the data record of line 006 of the dataquery result of Table XIII is presented on the top of the exemplarysorted query result, i.e., in line 002 of Table XV, as the Hemoglobintest value of this data record has the closest relative proximity to thepredefined Hemoglobin value.

At step 470, the sorted list of data records (e.g., sorted requesteddata 240 of FIG. 2B) is output. In the given example, the exemplarysorted query result of Table XV is output. Method 400 then exits at step480.

Sorting on the Basis of a Requested Value Range Coverage

Referring now back to FIG. 2B, the re-ordering of the requested data 230is performed in still another embodiment on the basis of a requestedvalue range coverage. The requested value range coverage is defined by apredefined maximum number 274 “VALUE COUNT” of data records of therequested data 230 to be output. Each data record has an associatedparticular value and the particular value of each of the outputted datarecords must be included within a predefined value range 272 “VALUERANGE”. Accordingly, in one embodiment the predefined maximum number 274of data records having associated particular values within thepredefined value range 272 is programmatically selected and output.

For instance, assume a researcher who wants to conduct a study on theeffects of alcohol on the liver of humans dependent on the weight ofcorresponding test persons. Assume now that the requested data 230includes data records having particular values for the weight ofrespective individuals. Assume further that the researcher requires 100test persons and that the 100 test persons should have weights which areincluded in a value range of 100 pounds-250 pounds. To this end, theresearcher using a suitable user interface (e.g., user interface 210 ofFIG. 2A) defines the predefined maximum number 274 to be 100 and thepredefined value range 272 to be 100 pounds-250 pounds. Assume now thatthe requested data 230 includes 1000 data records having particularvalues within the predefined value range 272. Thus, by specifying therequested range coverage to retrieve the 100 test persons, 100 datarecords would be selected programmatically and output. The 100 datarecords can be selected arbitrarily to satisfy the requested value rangecoverage.

More specifically, in order to determine a requested value rangecoverage for the data records of the requested data 230, the sortingprogram(s) 126 illustratively invokes a range coverage determinationunit 270 having the predefined value range 272 and the predefinedmaximum number 274. It should be noted that the range coveragedetermination unit 270 is represented as a separate unit only by way ofexample and not for limiting the invention accordingly. In other words,the range coverage determination unit 270 can also be implemented as anintegral part of the sorting program(s) 126 or some other suitablesystem program.

It should be noted that an arbitrary selection of the 100 data recordsin the given example may result in selection of 100 individuals allhaving an identical weight of 175 pounds, for example. However, as 100individuals having an identical weight are not considered beingrepresentative of the predefined value range 272, the user can use thesuitable user interface in one embodiment to specify how many datarecords having an identical associated particular value should be outputat maximum. For instance, the user can specify that not more than fivedata records associated with individuals having an identical weightshould be output. Accordingly, in the given example the 100 selecteddata records would represent individuals having at least 20 differentweights within the predefined value range 272.

In another embodiment, the particular values of the outputted datarecords must define a requested value distribution in the predefinedvalue range 272. As was noted above, the requested value distributioncan be defined by any possible type of distribution, such as a flatdistribution and a bell curve. However, it should be noted that a flatdistribution and a bell curve are merely described by way of example andthat other distribution types can also be requested, such as an invertedbell curve or a negative exponential distribution. Accordingly, all suchdistributions are broadly contemplated. For instance, assume that in thegiven example the researcher requires 100 test persons having weightswhich are evenly spread out over the value range of 100 pounds-250pounds, so that the weights of the 100 test persons can be considered asbeing representative of the complete value range. Thus, by specifyingthe requested range coverage to retrieve the 100 test persons such thatthe weights of the retrieved test persons define a flat distributionover the value range of 100 pounds-250 pounds, the best fit ofrepresentative data records would be selected programmatically.

In this case, the range coverage determination unit 270 determines foreach of the data records of the requested data 230 whether theparticular value of the data record is included within the predefinedvalue range 272. From all data records having their particular valueincluded within the predefined value range 272, a total number of datarecords is selected that is equal to, or at least does not exceed, thepredefined maximum number 274 (in this example, 100). The particularvalues of the selected data records define the requested valuedistribution.

In one embodiment, the requested value distribution is represented as ahistogram having one or more value windows, each having a specifiedvalue range defining a granularity of the value window. The granularitycan be user-specified or system and/or application specific. Accordingto one aspect, a user can specify a histogram using the suitable userinterface. For instance, in the given example the user can specify ahistogram representing a bell curve. By way of example, the user maydivide the value range of 100 pounds-250 pounds into five differentvalue windows, such as (1) 100 pounds-129 pounds, (2) 130 pounds to 159pounds, (3) 160 pounds-189 pounds, (4) 190 pounds-219 pounds, and (5)220 pounds to 250 pounds. Furthermore, the user may specify that fromthe 100 requested test persons (i) 15 persons should have weights withinthe value windows (1) and (5), respectively, (ii) 40 persons should haveweights within the value windows (2) and (4), respectively, and 90persons should have weights within the value window (3). Accordingly,the weights of all selected data records would define a bell curve.

The one or more selected data records can, for instance, be placed onthe top of the sorted list defining the sorted requested data 240.Alternatively, only the selected data records can be displayed in thesorted list on the display device 142, while the remaining data recordsare hidden to the user. An exemplary method for re-ordering therequested data 230 on the basis of a requested value range coverage isdescribed below with reference to FIGS. 5A-B.

Referring now to FIG. 5A, one embodiment of a method 500 for re-orderingrequested data (e.g., requested data 230 of FIG. 2B) on the basis of arequested value range coverage is shown. The requested data is obtainedin response to execution of a corresponding data request (e.g., datarequest 220 of FIG. 2A) against data in a database (e.g., data 136 ofdatabase 139 of FIG. 2A). Similarly to the methods 300 and 400 of FIGS.3 and 4, the method 500 is explained by way of example with respect to aquery issued against the data in the database in order to obtain acorresponding query result. At least part of the steps of the method 500can be performed by a suitable requesting entity (e.g., requestingapplication(s) 124 of FIG. 2A) and suitable functionalities of anassociated sorting program(s) (e.g., sorting program(s) 126 of FIG. 2B).Method 500 starts at step 510.

At step 520, the query is issued by a suitable requesting entity (e.g.,requesting application 124 of FIG. 2A). The issued query is executedagainst the data in the database. An exemplary query is shown in TableXVI below. For simplicity, the exemplary query of Table XVI is describedin natural language without reference to a particular query language.Thus, it is understood that any suitable query language, known orunknown, can be used to create the query of Table XVI. TABLE XVI QUERYEXAMPLE FIND Patient_ID, Hemoglobin SORT BY spread of Hemoglobin RETURN3 data records

Illustratively, the exemplary query shown in Table XVI includes dataselection criteria in lines 001-002. The data selection criteria includea result field specification (line 002) which specifies two resultfields for which information is to be returned in the query result.Specifically, in line 002 the result fields “Patient_ID” and“Hemoglobin” are specified. Assume now that information related to theresult fields “Patient_ID” and “Hemoglobin” is included with thedatabase table “Tests” illustrated in Table XI above. The exemplaryquery further includes sorting criteria in lines 003-006. The sortingcriteria indicate that all data records in the query result should besorted with respect to a spread of Hemoglobin values (line 004). In thiscase, the range of values which is defined by the Hemoglobin values ofthe query result constitutes a predefined value range (e.g., predefinedvalue range 272 of FIG. 2B) for the requested value range coverage.Specifically, the Hemoglobin test values in the “Tests” table of TableXI define the predefined value range [23; 45]. However, it should benoted that the predefined value range may also be provided by a userusing a suitable user interface (e.g., user interface 210 of FIG. 2A).The sorting criteria further indicate a predefined maximum number (e.g.,predefined maximum number 274 of FIG. 2B) which specifies that only “3”data records should be returned in the query result (line 006).

In one embodiment, executing the query at step 520 includes identifyingthe data selection criteria and the sorting criteria from the issuedquery. Executing the query further includes generating a data query onthe basis of the identified data selection criteria and executing thedata query against the database. In the given example, the dataselection criteria “FIND Patient_ID, Hemoglobin” can be identified fromthe issued query (lines 001-002 of Table XV). Furthermore, the sortingcriteria “SORT BY spread of Hemoglobin RETURN 3 data records” can beidentified from the issued query (lines 003-006 of Table XV).

The data query which can be generated on the basis of the identifieddata selection criteria corresponds to the data query shown in Table XIIabove. In other words, in the given example the data query of Table XIIis executed against the database table “Tests” illustrated in Table XIto determine the query result in an initial order for the exemplaryquery of Table XVI.

At step 530, the query result in the initial order is received. In thegiven example, receiving the query result in the initial ordercorresponds to receiving a data query result which corresponds to thedata query result shown in Table XIII, as described above with referenceto FIG. 4.

At step 540, a subset of the data records of the data query result ofTable XIII is selected which satisfies the requested value rangecoverage. Assume now that the subset of data records should be selectedsuch Hemoglobin test values associated with the data records of thesubset define a flat distribution over the predefined value range, i.e.,that the Hemoglobin test values are evenly spread over the predefinedvalue range. In other words, three of the data records which haveassociated Hemoglobin test values that are evenly spread over thepredefined value range [23; 45] are identified from the data queryresult of Table XIII. An exemplary method for identifying the subset ofdata records from the data query result is described below withreference to FIG. 5B.

At step 550, the data records in the data query result of Table XIII aresorted on the basis of the requested value range coverage. According toone aspect, the sorting comprises including only the three identifieddata records with the sorted query result. Alternatively, the threeidentified data records can be placed on the top of the sorted list.Furthermore, the three identified data records can be flagged toindicate that only display of these data records is allowed, while allremaining data records should be hidden to the user. By way of example,assume that in the given example only the three identified data recordsare included with the sorted list. Assume further that the data recordsof lines 003, 005 and 006 of Table XIII are identified. Accordingly, theexemplary sorted query result shown in Table XVII below is obtained.TABLE XVII EXEMPLARY SORTED QUERY RESULT Patient_ID Hemoglobin 1 23 2 332 45

At step 560, the sorted list of data records (e.g., sorted requesteddata 240 of FIG. 2B) is output. In the given example, the exemplarysorted query result of Table XVII is output. Method 500 then exits atstep 570.

Referring now to FIG. 5B, one embodiment of a method 548 for identifyingthe subset of data records from the data query result according to step540 of FIG. 5A is shown. The method 548 starts at step 541, where alldata records of the data query result which have an associated valuewithin the predefined value range are determined. In the given example,the associated values of all data records in the data query result ofTable XIII are included within the predefined value range [23; 45].

At step 542, a requested value distribution is determined for allassociated values which are included within the predefined value range.Assume now that in the given example a flat distribution in thepredefined value range [23; 45] is requested. Assume further that threevalue windows are specified for the flat distribution, such as [23;30],[31;38] and [39;45].

At step 544, all data records of the data query result are grouped intovalue groups on the basis of the specified value windows. Each valuegroup may include one or more data records. In the given example, theHemoglobin test values 23, 29, 33, 35 and 45 of the data records shownin Table XIII are grouped into three value groups: (i) the values 23 and29 are grouped into a first value group corresponding to the valuewindow [23;30], (ii) the values 33 and 35 are grouped into a secondvalue group corresponding to the value window [31;38], and (iii) thevalue 45 is grouped into a third value group corresponding to the valuewindow [39;45].

At step 545, one or more data records from at least a portion of thevalue groups are determined such that a total number of selected datarecords is equal to, or at least does not exceed, the predefined maximumnumber, i.e., “3”. In the given example, the one or more data recordsare selected to be evenly spread over the predefined value range inorder to define the requested flat distribution. Furthermore, datarecords for a maximum number of different values of the valuedistribution are determined, according to one aspect.

In the given example, the predefined maximum number of “3” data recordsis selected from the three different value groups. Accordingly, one datarecord is selected for each value group. As the values “23” and “45” ofthe first and third value groups are boundary values of the predefinedvalue range [23;45] and, thus, equidistant to a median value of thepredefined value range, i.e., “34”, the data records having these valuesare selected. Furthermore, a data record having an associated valuewhich is in the second value group is selected. As two data records haveassociated values in the second value group which are immediatelyadjacent to the median value, i.e., the data records having theassociated values “33” and “35”, one of both data records can beselected programmatically in an arbitrary manner so that the requestedflat distribution is satisfied. As was noted above, the data recordhaving the associated value “33” is selected. Processing then continuesat step 550 of FIG. 5A.

It should be noted that various implementations for selection of thedata records in order to satisfy a uniform spread over the valuedistribution are contemplated. All such implementations are broadlycontemplated. For instance, the selection can be based on additionalselection criteria provided by a user. More specifically, assume that inthe described example the Hemoglobin test value “35” has beenestablished for an individual living in Rochester, Minn., and that theHemoglobin test value “33” has been established for an individual livingin Houston, Tex. Assume further that the user specifies that datarecords for individuals living in Texas should be preferred.Accordingly, the data record having the Hemoglobin test value “33” foran individual living in Houston, Tex., is selected.

Sorting on the Basis of Suitability Scores

Referring now back to FIG. 2B, the re-ordering of the requested data 230is performed in still another embodiment on the basis of suitabilityscores which are determined with respect to the available analysisroutines 180. More specifically, a suitability score is determined foreach data record of the requested data 230. The suitability score of agiven data record indicates a relative suitability of the given datarecord as input to one or more of the analysis routines 180.

In order to determine the suitability scores for the data records of therequested data 230, the sorting program(s) 126 illustratively invokes ananalysis routine identification unit 280. It should be noted that theanalysis routine identification unit 280 is represented as a separateunit only by way of example and not for limiting the inventionaccordingly. In other words, the analysis routine identification unit280 can also be implemented as an integral part of the sortingprogram(s) 126 or some other suitable system component.

The analysis routine identification unit 280 identifies one or moreanalysis routines from the analysis routines 180 which are configuredfor processing the requested data 230. The analysis routineidentification unit 280 then identifies qualifiers, such as rowqualifiers and result set qualifiers for the identified analysisroutine(s). A row qualifier of a given analysis routine indicates apossible input field of the given analysis routine and may specify apreferred input value for the possible input field. A result setqualifier of a given analysis routine specifies characteristics whichqualify a result set that is suitable as input to the given analysisroutine. For instance, a result set qualifier may specify that only aresult set having Hemoglobin values for each data record is suitable. Inone embodiment, the result set qualifier of the given analysis routineindicates a preferred range of input values of the given analysisroutine. According to one aspect, the row qualifier(s) and/or result setqualifier(s) of the identified analysis routine(s) can be determinedfrom associated metadata 282.

On the basis of corresponding row and/or result set qualifiers, theanalysis routine identification unit 280 determines how suitable eachone of the data records of the requested data 230 is as input to theidentified analysis routine(s). In the case of an identified rowqualifier, the analysis routine identification unit 280 determines for agiven data record having a particular value whether an underlying typeof the particular value of that data record corresponds to an input typeof the possible input field of the identified analysis routine(s). Eachtime a match of the types is encountered, the suitability score of thegiven data record is modified. Modifying the suitability score includes,by way of example, increasing or decreasing the suitability score. Inthe case of an identified result set qualifier, the result set qualifiercan be transformed into a set of one time row qualifiers, each of whichcan be processed similar to the processing of the row qualifier, asdescribed above. Thus, data records which are most suitable as input tothe identified analysis routine(s) can be identified and placed on thetop of a corresponding sorted list. An exemplary method for re-orderingthe requested data 230 on the basis of suitability scores which aredetermined with respect to the available analysis routines 180 isdescribed below with reference to FIGS. 6A-C.

Referring now to FIG. 6A, one embodiment of a method 600 for re-orderingrequested data (e.g., requested data 230 of FIG. 2B) on the basis ofsuitability scores is shown. The suitability scores are determined fordata records included with the requested data with respect to analysisroutines which are configured to process the data records. The requesteddata is obtained in response to execution of a corresponding datarequest (e.g., data request 220 of FIG. 2A) against data in a database(e.g., data 136 of database 139 of FIG. 2A). Similarly to the methods300, 400 and 500 of FIGS. 3, 4 and 5, the method 600 is explained by wayof example with respect to a query issued against the data in thedatabase in order to obtain a corresponding query result. At least partof the steps of the method 600 can be performed by a suitable requestingentity (e.g., requesting application(s) 124 of FIG. 2A) and suitablefunctionalities of an associated sorting program(s) (e.g., sortingprogram(s) 126 of FIG. 2B). Method 600 starts at step 610.

At step 620, the query is issued by a suitable requesting entity (e.g.,requesting application 124 of FIG. 2A). The issued query is executedagainst the data in the database. An exemplary query is shown in TableXVIII below. For simplicity, the exemplary query of Table XVIII isdescribed in natural language without reference to a particular querylanguage. Thus, it is understood that any suitable query language, knownor unknown, can be used to create the query of Table XVIII. TABLE XVIIIQUERY EXAMPLE FIND Patient_ID, Hemoglobin SORT BY available analysisroutines

Illustratively, the exemplary query shown in Table XVIII includes dataselection criteria in lines 001-002. The data selection criteria includea result field specification (line 002) which specifies two resultfields for which information is to be returned in the query result.Specifically, in line 002 the result fields “Patient_ID” and“Hemoglobin” are specified. Assume now that information related to theresult fields “Patient_ID” and “Hemoglobin” is included with thedatabase table “Tests” illustrated in Table XI above. The exemplaryquery further includes sorting criteria in lines 003-004. The sortingcriteria indicate that all data records in the query result should besorted with respect to available analysis routines (line 004).

In one embodiment, executing the query at step 620 includes identifyingthe data selection criteria and the sorting criteria from the issuedquery. Executing the query further includes generating a data query onthe basis of the identified data selection criteria and executing thedata query against the database. In the given example, the dataselection criteria “FIND Patient_ID, Hemoglobin” can be identified fromthe issued query (lines 001-002 of Table XVIII). Furthermore, thesorting criteria “SORT BY available analysis routines” can be identifiedfrom the issued query (lines 003-004 of Table XVIII).

The data query which can be generated on the basis of the identifieddata selection criteria corresponds to the data query shown in Table XIIabove. Thus, in the given example the data query of Table XII isexecuted against the database table “Tests” illustrated in Table XI todetermine the query result in an initial order for the exemplary queryof Table XVIII.

At step 630, the query result in the initial order is received. In thegiven example, receiving the query result in the initial ordercorresponds to receiving the data query result of Table XIII, asdescribed above with reference to FIG. 4.

At step 640, all analysis routines which are configured to process thedata query result are identified from a plurality of available analysisroutines (e.g., analysis routines 180 of FIG. 2B). According to oneaspect, identifying the analysis routines which are configured toprocess the data query result includes accessing metadata associatedwith the analysis routines (e.g., metadata 282 of FIG. 2B). Theassociated metadata may include qualifiers, such as row and result setqualifiers, which specify a type of query result that can be processedby corresponding analysis routines.

At step 650, a suitability score is determined for each data record ofthe data query result. The suitability score of a given data recordindicates a relative suitability of the given data record as input tothe identified analysis routine(s). Exemplary methods for determiningsuitability scores are described below with reference to FIGS. 6B-C.

At step 660, the data records in the data query result are sorted on thebasis of the determined suitability scores. At step 670, the sorted listof data records (e.g., sorted requested data 240 of FIG. 2B) is output.Method 600 then exits at step 680.

Referring now to FIG. 6B, one embodiment of a method 690 for determiningsuitability scores for data records of a data query result (e.g., thedata query result of Table XIII) according to step 650 of FIG. 6A isshown. The method 690 starts at step 651, where a loop consisting ofsteps 651-653 is entered for each analysis routine that is identified atstep 640 of FIG. 6A.

At step 651, the loop is entered for a given analysis routine. At step652, all row qualifiers which are associated with the given analysisroutine are identified. According to one aspect, each row qualifierindicates a possible input field of the given analysis routine.Furthermore, each row qualifier may specify a preferred input value forthe possible input field. Moreover, in one embodiment each row qualifiermay have an associated weight. For instance, a first row qualifier maydefine that a given data record having a Hemoglobin test value greaterthan 35 is suitable as input to the given analysis routine. The givenanalysis routine may further have a second row qualifier which definesthat a given data record having an Age value greater than 30 is alsosuitable as input to the given analysis routine. However, assume thatthe given analysis routine performs better on data records having higherHemoglobin test values than on data records having higher Age values. Inthis case, the first row qualifier may be associated with a higherweight than the second row qualifier. Then, at step 653 the possibleinput fields, the preferred input values and the associated weights ofthe identified row qualifiers are identified. When the loop consistingof steps 651-653 has been executed for each identified analysis routine,processing continues at step 654.

At step 654, each result field of each data record of the data queryresult is compared with the identified possible input fields. For allmatching fields, the value of the corresponding result field is comparedwith the preferred input value of the matching possible input field.

At step 655, for each data record of the data query result, all matchingfields are counted. Optionally, all associated weights are applied tothe counted matching fields.

At step 656, relative proximities for all matching fields of each datarecord of the data query result are determined. More specifically, foreach result field of a given data record that matches a possible inputfield defined by one of the identified row qualifiers, a relativeproximity between the value of the result field and the preferred inputvalue of the matched possible input field is determined. In oneembodiment, all associated weights are applied to the determinedrelative proximities.

According to one aspect, if the preferred input value of a givenpossible input field is associated with a comparison operator, adifference value between the preferred input value of the possible inputfield and the values of matching result fields can be determined insteadof a relative proximity. For instance, in the example described abovethe first row qualifier defines that a given data record having aHemoglobin test value greater than 35 is suitable as input to the givenanalysis routine. Accordingly, a data record having a Hemoglobin testvalue of 55 has a difference value of 20 with respect to the predefinedHemoglobin value of 35 (i.e., 55−35=20) and a data record having aHemoglobin test value of 49 has a difference value of 14 (i.e.,49−35=14).

At step 657, the suitability scores for all data records of the dataquery result are determined on the basis of the counted matching fieldsand/or the determined relative proximities. More specifically, accordingto one aspect, the suitability score of a given data record can beincreased or decreased for each matching field with respect to any ofthe identified analysis routines. The suitability score may also beincreased or decreased on the basis of each determined relativeproximity or difference value of the given data record with respect toeach identified analysis routine. Furthermore, the increase/decrease maybe dependent on the determined relative proximity or difference value.For instance, a greater relative proximity may result in a higherincrease/decrease. More specifically, in the above example it is assumedthat the given analysis routine performs better if the Hemoglobin testvalue of a given data record and, thus, the corresponding differencevalue is high. Accordingly, the given analysis routine performs betteron the data record having the Hemoglobin test value of 55 and thedifference value of 20. Thus, this data record may have a higherincrease of its suitability score with respect to the given analysisroutine than the data record having the Hemoglobin test value of 49 andthe difference value of 14. Processing then continues at step 660 ofFIG. 6A.

By way of example, assume that at step 640 of FIG. 6A only a singleanalysis routine is identified, which is configured to process the datarecords of the data query result of Table XIII. Assume further that atstep 652 the first row qualifier described above is identified for thesingle analysis routine. As was noted above, the first row qualifierspecifies as possible input field the field “Hemoglobin” and aspreferred input value values which are greater than 35. Accordingly, theexemplary sorted query result shown in Table XIX below is obtained.TABLE XIX EXEMPLARY SORTED QUERY RESULT Patient_ID Hemoglobin 2 45 3 352 33 1 29 1 23

Note that in the given example the data record of line 005 of the dataquery result of Table XIII is presented on the top of the exemplarysorted query result, i.e., in line 002 of Table XIX, as this data recordhas the greatest Hemoglobin test value.

It should be noted that the determined suitability scores can beexpressed by a plurality of score portions, wherein each score portionis related to a different identified analysis routine. In oneembodiment, each score portion can be normalized in order to limit theability of a single identified analysis routine to push a particulardata record to the top of the sorted list of data records. Furthermore,all score portions of the plurality of score portions of a givensuitability score can be determined and stored separately. In this case,the data query result (e.g., the data query result of Table XIII) can bepresented to a user. Thus, the user may decide which analysis routine(s)to use. Accordingly, the sorting can be based on the score portionsassociated with the user-selected analysis routine(s), as describedabove.

Referring now to FIG. 6C, another embodiment of a method 695 fordetermining suitability scores for data records of a data query result(e.g., the data query result of Table XIII) according to step 650 ofFIG. 6A is shown. The method 695 starts at step 658, where a loopconsisting of steps 658, 659, 691, 692 and 693 is entered for eachanalysis routine that is identified at step 640 of FIG. 6A.

At step 658, the loop is entered for a given analysis routine. At step659, a result set qualifier which is associated with the given analysisroutine is identified. According to one aspect, the result set qualifierindicates a preferred range of input values for a possible input fieldof the given analysis routine. For instance, a given result setqualifier may define that a given data record having Hemoglobin testvalues between 20 and 50 is suitable as input to the given analysisroutine.

At step 691, the preferred range of input values for the possible inputfield is determined from the identified result set qualifier. In thegiven example, the value range [20; 50] is determined.

At step 692, a distribution of values spread over the preferred range ofinput values is determined. To this end, a number of values of thepreferred range of input values is identified such that the identifiedvalues are uniformly spread over the preferred range of input values.For instance, the distribution of values may be determinedprogrammatically to include each integer number in the value range [20;50].

In one embodiment, a predefined number can be provided for determinationof the distribution of values. By way of example, the predefined numbercan be provided with the issued query (i.e., the exemplary query ofTable XVIII). Thus, the predefined number of values can be identifiedfrom the preferred range of values to define the distribution of values.For instance, assume that in the given example the predefined number is“11”. Accordingly, “11” uniformly spread values of the preferred rangeof values [20; 50] are determined for the distribution of values. By wayof example, the values 20, 23, 26, 29, 32, 35, 38, 41, 44, 47, 50 areidentified. At step 693, a unique temporary row qualifier is created foreach identified value of the distribution of values.

When the loop consisting of steps 658-693 has been executed for eachidentified analysis routine, processing continues at step 654 of FIG.6B, where each unique temporary row qualifier is processed similar to arow qualifier (as identified at step 652 of FIG. 6B). However, in oneembodiment, if a match is determined for a possible input field and/orpreferred input value of a given temporary row qualifier at step 654,the given temporary row qualifier is deleted.

As was noted above, queries issued by a suitable requesting entity(e.g., requesting application 124 of FIG. 1) can be abstract queriesformulated on the basis of a data abstraction model (e.g., dataabstraction model 132 of FIG. 1). An abstract query can be transformedby a suitable runtime component (e.g., runtime component 134 of FIG. 1)into a concrete query having a form consistent with the physicalrepresentation of data contained in an underlying database (e.g., data136 in database 139 of FIG. 1). The concrete queries can be executed bythe runtime component against the database. An exemplary dataabstraction model, creation of abstract queries and operation of anexemplary runtime component are further described below with referenceto FIGS. 7-10.

Sorting in an Abstract Query Environment

Referring now to FIG. 7, a relational view illustrating operation andinteraction of the requesting application 124 of FIG. 1 and the dataabstraction model 132 of FIG. 1 is shown. The data abstraction model 132defines logical fields corresponding to physical entities of data in adatabase (e.g., data 136 in database 139), thereby providing a logicalrepresentation of the data. In a relational database environment havinga multiplicity of database tables, a specific logical representationhaving specific logical fields can be provided for each database table.In this case, all specific logical representations together constitutethe data abstraction model 132. The physical entities of the data arearranged in the database according to a physical representation of thedata in the database. By way of illustration, two physicalrepresentations are shown, an XML data representation 714 ₁ and arelational data representation 714 ₂. However, the physicalrepresentation 714 _(N) indicates that any other physicalrepresentation, known or unknown, is contemplated. In one embodiment, adifferent single data abstraction model is provided for each separatephysical representation 714, as explained above for the case of arelational database environment. In an alternative embodiment, a singledata abstraction model 132 contains field specifications (withassociated access methods) for two or more physical representations 714.

Using a logical representation of the data, the application queryspecification 122 of FIG. 1 specifies one or more logical fields tocompose a resulting query 702. A requesting entity (e.g., the requestingapplication 124) issues the resulting query 702 as defined by anapplication query specification of the requesting entity. In oneembodiment, the abstract query 702 may include both criteria used fordata selection and an explicit specification of result fields to bereturned based on the data selection criteria. An example of theselection criteria and the result field specification of the abstractquery 702 is shown in FIG. 8. Accordingly, the abstract query 702illustratively includes selection criteria 804 and a result fieldspecification 806.

The resulting query 702 is generally referred to herein as an “abstractquery” because the query is composed according to abstract (i.e.,logical) fields rather than by direct reference to the underlyingphysical data entities in the database. As a result, abstract queriesmay be defined that are independent of the particular underlyingphysical data representation used. For execution, the abstract query istransformed into a concrete query consistent with the underlyingphysical representation of the data using the data abstraction model132.

In general, the data abstraction model 132 exposes information as a setof logical fields that may be used within an abstract query to specifycriteria for data selection and specify the form of result data returnedfrom a query operation. The logical fields are defined independently ofthe underlying physical representation being used in the database,thereby allowing abstract queries to be formed that are loosely coupledto the underlying physical representation.

Referring now to FIG. 8, a relational view illustrating interaction ofthe abstract query 702 and the data abstraction model 132 is shown. Inone embodiment, the data abstraction model 132 comprises a plurality offield specifications 808 ₁, 808 ₂, 808 ₃, 808 ₄ and 808 ₅ (five shown byway of example), collectively referred to as the field specifications808. Specifically, a field specification is provided for each logicalfield available for composition of an abstract query. Each fieldspecification may contain one or more attributes. Illustratively, thefield specifications 808 include a logical field name attribute 820 ₁,820 ₂, 820 ₃, 820 ₄, 820 ₅ (collectively, field name 820) and anassociated access method attribute 822 ₁, 822 ₂, 822 ₃, 822 ₄, 822 ₅(collectively, access methods 822). Each attribute may have a value. Forexample, logical field name attribute 820 ₁ has the value “FirstName”and access method attribute 822 ₁ has the value “Simple”. Furthermore,each attribute may include one or more associated abstract properties.Each abstract property describes a characteristic of a data structureand has an associated value. In the context of the invention, a datastructure refers to a part of the underlying physical representationthat is defined by one or more physical entities of the datacorresponding to the logical field. In particular, an abstract propertymay represent data location metadata abstractly describing a location ofa physical data entity corresponding to the data structure, like a nameof a database table or a name of a column in a database table.Illustratively, the access method attribute 822, includes data locationmetadata “Table” and “Column”. Furthermore, data location metadata“Table” has the value “contact” and data location metadata “Column” hasthe value “f_name”. Accordingly, assuming an underlying relationaldatabase schema in the present example, the values of data locationmetadata “Table” and “Column” point to a table “contact” having a column“f_name”.

In one embodiment, groups (i.e. two or more) of logical fields may bepart of categories. Accordingly, the data abstraction model 132 includesa plurality of category specifications 810 ₁ and 810 ₂ (two shown by wayof example), collectively referred to as the category specifications. Inone embodiment, a category specification is provided for each logicalgrouping of two or more logical fields. For example, logical fields 808₁₋₃ and 808 ₄₋₅ are part of the category specifications 810 ₁ and 810 ₂,respectively. A category specification is also referred to herein simplyas a “category”. The categories are distinguished according to acategory name, e.g., category names 830 ₁ and 830 ₂ (collectively,category name(s) 830). In the present illustration, the logical fields808 ₁₋₃ are part of the “Name and Address” category and logical fields808 ₄₋₅ are part of the “Birth and Age” category.

The access methods 822 generally associate (i.e., map) the logical fieldnames to data in the database (e.g., database 139 of FIG. 1). Any numberof access methods is contemplated depending upon the number of differenttypes of logical fields to be supported. In one embodiment, accessmethods for simple fields, filtered fields and composed fields areprovided. The field specifications 808 ₁, 808 ₂ and 808 ₅ exemplifysimple field access methods 822 ₁, 822 ₂, and 822 ₅, respectively.Simple fields are mapped directly to a particular entity in theunderlying physical representation (e.g., a field mapped to a givendatabase table and column). By way of illustration, as described above,the simple field access method 822 ₁ shown in FIG. 8 maps the logicalfield name 820 ₁ (“FirstName”) to a column named “f_name” in a tablenamed “contact”. The field specification 808 ₃ exemplifies a filteredfield access method 822 ₃. Filtered fields identify an associatedphysical entity and provide filters used to define a particular subsetof items within the physical representation. An example is provided inFIG. 8 in which the filtered field access method 822 ₃ maps the logicalfield name 820 ₃ (“AnyTownLastName”) to a physical entity in a columnnamed “I_name” in a table named “contact” and defines a filter forindividuals in the city of “Anytown”. Another example of a filteredfield is a New York ZIP code field that maps to the physicalrepresentation of ZIP codes and restricts the data only to those ZIPcodes defined for the state of New York. The field specification 808 ₄exemplifies a composed field access method 822 ₄. Composed accessmethods compute a logical field from one or more physical fields usingan expression supplied as part of the access method definition. In thisway, information which does not exist in the underlying physical datarepresentation may be computed. In the example illustrated in FIG. 8 thecomposed field access method 822 ₄ maps the logical field name 8204“AgeInDecades” to “AgeInYears/10”. Another example is a sales tax fieldthat is composed by multiplying a sales price field by a sales tax rate.

It is contemplated that the formats for any given data type (e.g.,dates, decimal numbers, etc.) of the underlying data may vary.Accordingly, in one embodiment, the field specifications 808 include atype attribute which reflects the format of the underlying data.However, in another embodiment, the data format of the fieldspecifications 808 is different from the associated underlying physicaldata, in which case a conversion of the underlying physical data intothe format of the logical field is required.

By way of example, the field specifications 808 of the data abstractionmodel 132 shown in FIG. 8 are representative of logical fields mapped todata represented in the relational data representation 7142 shown inFIG. 7. However, other instances of the data abstraction model 132 maplogical fields to other physical representations, such as XML.

An illustrative abstract query corresponding to the abstract query 702shown in FIG. 8 is shown in Table XX below. By way of illustration, theillustrative abstract query is defined using XML. However, any otherlanguage may be used to advantage. TABLE XX ABSTRACT QUERY EXAMPLE <?xmlversion=“1.0”?> <!--Query string representation: (AgeInYears > “55”--><QueryAbstraction> <Selection> <Condition internalID=“4”> <Conditionfield=“AgeInYears” operator=“GT” value=“55” internalID=“1”/></Selection> <Results> <Field name=“FirstName”/> <Fieldname=“AnyTownLastName”/> <Field name=“Street”/> </Results></QueryAbstraction>

Illustratively, the abstract query shown in Table XX includes aselection specification (lines 004-008) containing selection criteriaand a results specification (lines 009-013). In one embodiment, aselection criterion consists of a field name (for a logical field), acomparison operator (=, >, <, etc) and a value expression (what is thefield being compared to). In one embodiment, result specification is alist of abstract fields that are to be returned as a result of queryexecution. A result specification in the abstract query may consist of afield name and sort criteria.

An illustrative data abstraction model (DAM) corresponding to the dataabstraction model 132 shown in FIG. 8 is shown in Table XXI below. Byway of illustration, the illustrative Data Abstraction Model is definedusing XML. However, any other language may be used to advantage. TABLEXXI DATA ABSTRACTION MODEL EXAMPLE <?xml version=“1.0”?><DataAbstraction> <Category name=“Name and Address”> <Fieldqueryable=“Yes” name=“FirstName” displayable=“Yes”> <AccessMethod><Simple columnName=“f_name” tableName=“contact”></Simple> </AccessMethod> </Field> <Field queryable=“Yes” name=“LastName”displayable=“Yes”> <AccessMethod> <Simple columnName=“l_name”tableName=“contact”></Simple>  </AccessMethod> </Field> <Fieldqueryable=“Yes” name=“AnyTownLastName” displayable=“Yes”> <AccessMethod><Filter columnName=“l_name” tableName=“contact”></Filter=“contact.city=Anytown”>  </AccessMethod> </Field> </Category><Category name=“Birth and Age”> <Field queryable=“Yes”name=“AgeInDecades” displayable=“Yes”> <AccessMethod> <ComposedcolumnName=“age” tableName=“contact”>  </ComposedExpression=“columnName/10”>  </AccessMethod> </Field> <Fieldqueryable=“Yes” name=“AgeInYears” displayable=“Yes”> <AccessMethod><Simple columnName=“age” tableName=“contact”></Simple> </AccessMethod></Field> </Category> </DataAbstraction>

By way of example, note that lines 004-008 correspond to the first fieldspecification 808 ₁ of the DAM 132 shown in FIG. 8 and lines 009-013correspond to the second field specification 808 ₂.

Referring now to FIG. 9, an illustrative runtime method 900 exemplifyingone embodiment of the operation of the runtime component 134 of FIG. 1is shown. The method 900 is entered at step 902 when the runtimecomponent receives as input an abstract query (such as the abstractquery shown in Table XX). At step 904, the runtime component reads andparses the abstract query and locates individual selection criteria anddesired result fields. At step 906, the runtime component enters a loop(comprising steps 906, 908, 910 and 912) for processing each queryselection criteria statement present in the abstract query, therebybuilding a data selection portion of a concrete query. In oneembodiment, a selection criterion consists of a field name (for alogical field), a comparison operator (=, >, <, etc) and a valueexpression (what is the field being compared to). At step 908, theruntime component uses the field name from a selection criterion of theabstract query to look up the definition of the field in the dataabstraction model 132 of FIG. 1. As noted above, the field definitionincludes a definition of the access method used to access the physicaldata associated with the field. The runtime component then builds (step910) a concrete query contribution for the logical field beingprocessed. As defined herein, a concrete query contribution is a portionof a concrete query that is used to perform data selection based on thecurrent logical field. A concrete query is a query represented inlanguages like SQL and XML Query and is consistent with the data of agiven physical data repository (e.g., a relational database or XMLrepository). Accordingly, the concrete query is used to locate andretrieve data from the physical data repository, represented by thedatabase 139 shown in FIG. 1. The concrete query contribution generatedfor the current field is then added to a concrete query statement. Themethod 900 then returns to step 906 to begin processing for the nextfield of the abstract query. Accordingly, the process entered at step906 is iterated for each data selection field in the abstract query,thereby contributing additional content to the eventual query to beperformed.

After building the data selection portion of the concrete query, theruntime component identifies the information to be returned as a resultof query execution. As described above, in one embodiment, the abstractquery defines a list of logical fields that are to be returned as aresult of query execution, referred to herein as a result specification.A result specification in the abstract query may consist of a field nameand sort criteria. Accordingly, the method 900 enters a loop at step 914(defined by steps 914, 916, 918 and 920) to add result field definitionsto the concrete query being generated. At step 916, the runtimecomponent looks up a result field name (from the result specification ofthe abstract query) in the data abstraction model 132 and then retrievesa result field definition from the data abstraction model 132 toidentify the physical location of data to be returned for the currentlogical result field. The runtime component then builds (at step 918) aconcrete query contribution (of the concrete query that identifiesphysical location of data to be returned) for the logical result field.At step 920, the concrete query contribution is then added to theconcrete query statement. Once each of the result specifications in theabstract query has been processed, the concrete query is executed atstep 922.

One embodiment of a method 1000 for building a concrete querycontribution for a logical field according to steps 910 and 918 isdescribed with reference to FIG. 9. At step 1002, the method 1000queries whether the access method associated with the current logicalfield is a simple access method. If so, the concrete query contributionis built (step 1004) based on physical data location information andprocessing then continues according to method 900 described above.Otherwise, processing continues to step 1006 to query whether the accessmethod associated with the current logical field is a filtered accessmethod. If so, the concrete query contribution is built (step 1008)based on physical data location information for some physical dataentity. At step 1010, the concrete query contribution is extended withadditional logic (filter selection) used to subset data associated withthe physical data entity. Processing then continues according to method900 described above.

If the access method is not a filtered access method, processingproceeds from step 1006 to step 1012 where the method 1000 querieswhether the access method is a composed access method. If the accessmethod is a composed access method, the physical data location for eachsub-field reference in the composed field expression is located andretrieved at step 1014. At step 1016, the physical field locationinformation of the composed field expression is substituted for thelogical field references of the composed field expression, whereby theconcrete query contribution is generated. Processing then continuesaccording to method 400 described above.

If the access method is not a composed access method, processingproceeds from step 1012 to step 1018. Step 1018 is representative of anyother access methods types contemplated as embodiments of the presentinvention. However, it should be understood that embodiments arecontemplated in which less then all the available access methods areimplemented. For example, in a particular embodiment only simple accessmethods are used. In another embodiment, only simple access methods andfiltered access methods are used.

While the foregoing is directed to embodiments of the present invention,other and further embodiments of the invention may be devised withoutdeparting from the basic scope thereof, and the scope thereof isdetermined by the claims that follow.

1. A computer-implemented method of ordering query results, comprising:in response to a query issued by a requesting entity: a) receiving alist of data records ordered according to an initial order, the list ofdata records defining a result set for the query; b) before outputtingthe result set, accessing a data source to retrieve information relatedto the received list of data records; c) sorting the received list ofdata records on the basis of the retrieved information; and d)outputting the sorted list of data records.
 2. The method of claim 1,wherein the retrieved information comprises annotations associated withthe received list of data records.
 3. The method of claim 1, wherein thequery comprises: (i) data selection criteria configured to select thedata records of the list of data records from a database; and (ii)sorting criteria configured to specify the information related to thereceived list of data records.
 4. The method of claim 3, furthercomprising: identifying the data selection criteria from the issuedquery; generating a first query on the basis of the identified dataselection criteria; identifying the sorting criteria from the issuedquery; and generating a second query on the basis of the identifiedsorting criteria.
 5. The method of claim 4, wherein at least one of theissued query, the first query and the second query is one of an SQL andan XML query.
 6. The method of claim 4, further comprising: executingthe first query against a first database to identify the data records ofthe list of data records; and executing the second query against asecond database to identify the information related to the list of datarecords.
 7. The method of claim 6, wherein the issued query, the firstquery and the second query are abstract queries, each having one or morelogical fields of at least one data abstraction model abstractlydescribing data in the first and second databases; and wherein the atleast one data abstraction model is adapted for transforming the one ormore logical fields of the abstract queries into a form consistent witha physical representation of the data in the first and second databases.8. The method of claim 6, wherein the first and second databases areserver-side data sources and the sorting is done by a client-sideapplication.
 9. The method of claim 6, wherein the first and seconddatabases are server-side data sources and the sorting is done by aserver-side application.
 10. The method of claim 1, wherein sorting thereceived list of data records on the basis of the retrieved informationcomprises: for each data record in the list, counting a total number ofassociated annotations; and wherein sorting the received list of datarecords is performed on the basis of the counted total numbers.
 11. Themethod of claim 1, wherein sorting the received list of data records onthe basis of the retrieved information comprises: applying predefinedsorting criteria to the retrieved information to determine a ranking ofthe data records in the list; and sorting the data records in the listaccording to the determined ranking.
 12. The method of claim 1, whereinsorting the received list of data records on the basis of the retrievedinformation comprises: ranking the retrieved information according toinformation types.
 13. The method of claim 1, wherein sorting thereceived list of data records on the basis of the retrieved informationcomprises: ranking the retrieved information according to informationattributes.
 14. A computer-implemented method of ordering query results,comprising: in response to a query issued by a requesting entity: a)receiving a list of data records ordered according to an initial order,the list of data records defining a result set for the query; b) beforeoutputting the result set, determining a value variance for each datarecord in the list, the value variance of a given data record indicatinga relative proximity between a predefined value and a correspondingvalue of the given data record; c) sorting the received list of datarecords on the basis of the determined value variances; and d)outputting the sorted list of data records.
 15. The method of claim 14,wherein sorting the received list of data records on the basis of thepredefined value variance comprises: ranking the data records accordingto the determined relative proximities.
 16. The method of claim 14,wherein the query comprises: (i) data selection criteria configured toselect the data records of the list of data records from a database; and(ii) sorting criteria configured to specify the predefined value. 17.The method of claim 16, further comprising: identifying the dataselection criteria from the issued query; identifying the sortingcriteria from the issued query; and generating a query on the basis ofthe identified data selection criteria.
 18. The method of claim 17,wherein at least one of the issued query and the generated query is oneof an SQL and an XML query.
 19. The method of claim 17, furthercomprising: executing the generated query against the database toidentify the data records of the list of data records.
 20. The method ofclaim 19, wherein the issued query and the generated query are abstractqueries, each having one or more logical fields of a data abstractionmodel abstractly describing data in the database; and wherein the dataabstraction model is adapted for transforming the one or more logicalfields of the abstract queries into a form consistent with a physicalrepresentation of the data in the database.
 21. The method of claim 19,wherein the database is a server-side data source and the sorting isdone by a client-side application.
 22. The method of claim 19, whereinthe database is a server-side data source and the sorting is done by aserver-side application.
 23. A computer-implemented method of orderingquery results, comprising: in response to a query issued by a requestingentity: a) receiving a list of data records ordered according to aninitial order, the list of data records defining a result set for thequery; b) before outputting the result set, identifying a subset of thedata records in the list to satisfy a requested value range coverage,the requested value range coverage being defined by a predefined maximumnumber of data records of the list to be output, each having acorresponding value within a predefined value range; c) sorting thereceived list of data records on the basis of the requested value rangecoverage; and d) outputting the sorted list of data records.
 24. Themethod of claim 23, wherein identifying the subset of the data recordscomprises: for each data record in the list, determining whether a valueof the data record is included with the predefined value range; for allvalues of data records having a value included with the predefined valuerange, select the predefined maximum number of data records such thatthe values of the selected data records define a requested valuedistribution.
 25. The method of claim 24, wherein the requested valuedistribution comprises at least one of a flat distribution and a bellcurve.
 26. The method of claim 24, wherein the requested valuedistribution is represented by a histogram having one or more valuewindows.
 27. The method of claim 24, wherein outputting the sorted listof data records comprises: allowing display of the one or more selecteddata records on a display device; and hiding the remaining data recordsfrom display.
 28. The method of claim 23, wherein the query comprises:(i) data selection criteria configured to select the data records of thelist of data records from a database; and (ii) sorting criteriaconfigured to specify the predefined maximum number and the predefinedvalue range.
 29. The method of claim 28, further comprising: identifyingthe data selection criteria from the issued query; identifying thesorting criteria from the issued query; and generating a query on thebasis of the identified data selection criteria.
 30. The method of claim29, wherein at least one of the issued query and the generated query isone of an SQL and an XML query.
 31. The method of claim 29, furthercomprising: executing the generated query against the database toidentify the data records of the list of data records.
 32. The method ofclaim 31, wherein the issued query and the generated query are abstractqueries, each having one or more logical fields of a data abstractionmodel abstractly describing data in the database; and wherein the dataabstraction model is adapted for transforming the one or more logicalfields of the abstract queries into a form consistent with a physicalrepresentation of the data in the database.
 33. The method of claim 31,wherein the database is a server-side data source and the sorting isdone by a client-side application.
 34. The method of claim 31, whereinthe database is a server-side data source and the sorting is done by aserver-side application.
 35. A computer-readable medium containing aprogram which, when executed by a processor, performs operations forordering query results, the operations comprising: in response to aquery issued by a requesting entity: a) receiving a list of data recordsordered according to an initial order, the list of data records defininga result set for the query; b) before outputting the result set,accessing a data source to retrieve information related to the receivedlist of data records; c) sorting the received list of data records onthe basis of the retrieved information; and d) outputting the sortedlist of data records.
 36. The computer-readable medium of claim 35,wherein the retrieved information comprises annotations associated withthe received list of data records.
 37. The computer-readable medium ofclaim 35, wherein the query comprises: (i) data selection criteriaconfigured to select the data records of the list of data records from adatabase; and (ii) sorting criteria configured to specify theinformation related to the received list of data records.
 38. Thecomputer-readable medium of claim 37, wherein the operations furthercomprise: identifying the data selection criteria from the issued query;generating a first query on the basis of the identified data selectioncriteria; identifying the sorting criteria from the issued query; andgenerating a second query on the basis of the identified sortingcriteria.
 39. The computer-readable medium of claim 38, wherein at leastone of the issued query, the first query and the second query is one ofan SQL and an XML query.
 40. The computer-readable medium of claim 38,wherein the operations further comprise: executing the first queryagainst a first database to identify the data records of the list ofdata records; and executing the second query against a second databaseto identify the information related to the list of data records.
 41. Thecomputer-readable medium of claim 40, wherein the issued query, thefirst query and the second query are abstract queries, each having oneor more logical fields of at least one data abstraction model abstractlydescribing data in the first and second databases; and wherein the atleast one data abstraction model is adapted for transforming the one ormore logical fields of the abstract queries into a form consistent witha physical representation of the data in the first and second databases.42. The computer-readable medium of claim 40, wherein the first andsecond databases are server-side data sources and the sorting is done bya client-side application.
 43. The computer-readable medium of claim 40,wherein the first and second databases are server-side data sources andthe sorting is done by a server-side application.
 44. Thecomputer-readable medium of claim 35, wherein sorting the received listof data records on the basis of the retrieved information comprises: foreach data record in the list, counting a total number of associatedannotations; and wherein sorting the received list of data records isperformed on the basis of the counted total numbers.
 45. Thecomputer-readable medium of claim 35, wherein sorting the received listof data records on the basis of the retrieved information comprises:applying predefined sorting criteria to the retrieved information todetermine a ranking of the data records in the list; and sorting thedata records in the list according to the determined ranking.
 46. Thecomputer-readable medium of claim 35, wherein sorting the received listof data records on the basis of the retrieved information comprises:ranking the retrieved information according to information types. 47.The computer-readable medium of claim 35, wherein sorting the receivedlist of data records on the basis of the retrieved informationcomprises: ranking the retrieved information according to informationattributes.
 48. A computer-readable medium containing a program which,when executed by a processor, performs operations for ordering queryresults, the operations comprising: in response to a query issued by arequesting entity: a) receiving a list of data records ordered accordingto an initial order, the list of data records defining a result set forthe query; b) before outputting the result set, determining a valuevariance for each data record in the list, the value variance of a givendata record indicating a relative proximity between a predefined valueand a corresponding value of the given data record; c) sorting thereceived list of data records on the basis of the determined valuevariances; and d) outputting the sorted list of data records.
 49. Thecomputer-readable medium of claim 48, wherein sorting the received listof data records on the basis of the predefined value variance comprises:ranking the data records according to the determined relativeproximities.
 50. The computer-readable medium of claim 48, wherein thequery comprises: (i) data selection criteria configured to select thedata records of the list of data records from a database; and (ii)sorting criteria configured to specify the predefined value.
 51. Thecomputer-readable medium of claim 50, wherein the operations furthercomprise: identifying the data selection criteria from the issued query;identifying the sorting criteria from the issued query; and generating aquery on the basis of the identified data selection criteria.
 52. Thecomputer-readable medium of claim 51, wherein at least one of the issuedquery and the generated query is one of an SQL and an XML query.
 53. Thecomputer-readable medium of claim 51, wherein the operations furthercomprise: executing the generated query against the database to identifythe data records of the list of data records.
 54. The computer-readablemedium of claim 53, wherein the issued query and the generated query areabstract queries, each having one or more logical fields of a dataabstraction model abstractly describing data in the database; andwherein the data abstraction model is adapted for transforming the oneor more logical fields of the abstract queries into a form consistentwith a physical representation of the data in the database.
 55. Thecomputer-readable medium of claim 53, wherein the database is aserver-side data source and the sorting is done by a client-sideapplication.
 56. The computer-readable medium of claim 53, wherein thedatabase is a server-side data source and the sorting is done by aserver-side application.
 57. A computer-readable medium containing aprogram which, when executed by a processor, performs operations forordering query results, the operations comprising: in response to aquery issued by a requesting entity: a) receiving a list of data recordsordered according to an initial order, the list of data records defininga result set for the query; b) before outputting the result set,identifying a subset of the data records in the list to satisfy arequested value range coverage, the requested value range coverage beingdefined by a predefined maximum number of data records of the list to beoutput, each having a corresponding value within a predefined valuerange; c) sorting the received list of data records on the basis of therequested value range coverage; and d) outputting the sorted list ofdata records.
 58. The computer-readable medium of claim 57, whereinidentifying the subset of the data records comprises: for each datarecord in the list, determining whether a value of the data record isincluded with the predefined value range; for all values of data recordshaving a value included with the predefined value range, select thepredefined maximum number of data records such that the values of theselected data records define a requested value distribution.
 59. Thecomputer-readable medium of claim 58, wherein the requested valuedistribution comprises at least one of a flat distribution and a bellcurve.
 60. The computer-readable medium of claim 58, wherein therequested value distribution is represented by a histogram having one ormore value windows.
 61. The computer-readable medium of claim 60,wherein outputting the sorted list of data records comprises: allowingdisplay of the one or more selected data records on a display device;and hiding the remaining data records from display.
 62. Thecomputer-readable medium of claim 57, wherein the query comprises: (i)data selection criteria configured to select the data records of thelist of data records from a database; and (ii) sorting criteriaconfigured to specify the predefined maximum number and the predefinedvalue range.
 63. The computer-readable medium of claim 62, wherein theoperations further comprise: identifying the data selection criteriafrom the issued query; identifying the sorting criteria from the issuedquery; and generating a query on the basis of the identified dataselection criteria.
 64. The computer-readable medium of claim 63,wherein at least one of the issued query and the generated query is oneof an SQL and an XML query.
 65. The computer-readable medium of claim63, wherein the operations further comprise: executing the generatedquery against the database to identify the data records of the list ofdata records.
 66. The computer-readable medium of claim 65, wherein theissued query and the generated query are abstract queries, each havingone or more logical fields of a data abstraction model abstractlydescribing data in the database; and wherein the data abstraction modelis adapted for transforming the one or more logical fields of theabstract queries into a form consistent with a physical representationof the data in the database.
 67. The computer-readable medium of claim65, wherein the database is a server-side data source and the sorting isdone by a client-side application.
 68. The computer-readable medium ofclaim 65, wherein the database is a server-side data source and thesorting is done by a server-side application.
 69. A computer system,comprising: a requesting entity; a data source residing in memory; and asorting program for ordering query results obtained in response to aquery issued by the requesting entity, the sorting program beingconfigured to: a) receive a list of data records ordered according to aninitial order, the list of data records defining a result set for thequery; b) before outputting the result set, access the data source toretrieve information related to the received list of data records; c)sort the received list of data records on the basis of the retrievedinformation; and d) output the sorted list of data records.
 70. Acomputer system, comprising: a requesting entity; and a sorting programfor ordering query results obtained in response to a query issued by therequesting entity, the sorting program being configured to: a) receive alist of data records ordered according to an initial order, the list ofdata records defining a result set for the query; b) before outputtingthe result set, determine a value variance for each data record in thelist, the value variance of a given data record indicating a relativeproximity between a predefined value and a corresponding value of thegiven data record; c) sort the received list of data records on thebasis of the determined value variances; and d) output the sorted listof data records.
 71. A computer system, comprising: a requesting entity;and a sorting program for ordering query results obtained in response toa query issued by the requesting entity, the sorting program beingconfigured to: a) receive a list of data records ordered according to aninitial order, the list of data records defining a result set for thequery; b) before outputting the result set, identify a subset of thedata records in the list to satisfy a requested value range coverage,the requested value range coverage being defined by a predefined maximumnumber of data records of the list to be output, each having acorresponding value within a predefined value range; c) sort thereceived list of data records on the basis of the requested value rangecoverage; and d) output the sorted list of data records.